package com.example.springbatchdemo.repo;

import com.example.springbatchdemo.config.db.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Classname UserRepo
 * @Description TODO
 * @Date 2020/9/29 23:30
 * @Created by kevin
 */
@Repository
public interface UserRepo extends JpaRepository<User,Integer> {


    @Query("SELECT new com.example.springbatchdemo.repo.UserDto(amount1,amount2,totalAge,username) FROM User")
    List<UserDto> queryAllUsers();
}
